from Tkinter import *          #This interface allow us to draw windows
from FileParser2 import *
from PythonTest import *
import tkFileDialog

def DrawList():
    file_path = tkFileDialog.askopenfilename(title="Open file", filetypes=[("txt file",".txt"),("All files",".*")])
    print file_path
    plist = ['Snap','Krackle','Pop', 'Rice Krispies']
    #plist.add(file_path)
    for item in plist:
         listbox.insert(END,item);

def FileRead():  
    file_path = open(tkFileDialog.askopenfilename(title="Open file", filetypes=[("txt file",".xml"),("All files",".*")]))
    string = ReadFile(file_path)
    listbox.insert(END,string)

def PimeX():
    Primes = []
    Primes = PrimeNumSearch()
    for p in Primes:
        listbox.insert(END,p)

root = Tk()                     #This creates a window, but it won't show up

listbox = Listbox(root)
button = Button(root,text = "Prime Numbers",command = PimeX)
button2 = Button(root,text = "File Parser", command = FileRead)

button.pack()
button2.pack()
listbox.pack()                  #this tells the listbox to come out
root.mainloop()                 #This command will tell the window come out
